<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>首页</title>
    <!-- Bootstrap -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    <link href="./css/profile_style.css" rel="stylesheet">
    <link href="./css/response.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
   <script src="./js/lib/jquery.min.js"></script>
   <script type="text/javascript">
    $(function (){
    	$.ajax({
    		url : 'http://www.udppvr.cn:80/profile/index.do',
    		success : function (rs) {
    			for(var i = 0 ;i < rs.total; i ++) {
    				var r = rs.rows[i];
    			 	var div = '<div style="border-bottom : 1px dotted gray; margin: auto 10px;">'
    		      	+'<span style="float : right;margin-top:10px;">'+r.nickName.substring(0,r.nickName.length >= 5 ? 5 : r.nickName.length )  +'&nbsp;&nbsp;'+r.gender+'&nbsp;&nbsp;结束时间&nbsp;&nbsp;'+r.endTime+'</span>'
    		      	+'<img class="img-circle" src="http://www.udppvr.cn:80/static/user_pics/'+r.photo+'" width="45" height="45" style="margin-right: 15px;"/>'
    		      +'<div style="clear:both;"></div></div>';
    		     $(".prolist").append(div);
    			}
    		},
    		dataType : 'json'
    	});
    });
 	// 我要排队
	function lineup(mid){
		$.ajax({
			url : 'http://www.udppvr.cn:80/profile/lineup.do?t='+(new Date()).getTime(),
			data : {
				id : mid
			},
			success : function (rs){
				if(!rs.iserror) {
					window.location.reload();
				}else{
					$("#modelText").text(rs.message);
					$('#myModal').modal();
				}
			},
			dataType : 'json'
		});
	}
  </script>
  </head>
  <body>
    <div id="sliderA" class="slider">
		<img class='ad'  src='./images/index01.jpg' />
		<img class='ad'  src='./images/index02.jpg' />
    </div><!--slider/-->	
    
    <div class="login-reg" style="margin-top:5px;">
     <a href="javascript:void(0);" onclick="return downloadPhonebook();" class="reg">免费一键加好友</a>
     <a href="./login.html" class="login">登录->别人加你</a>
    </div><!--login-reg/--> 
    
    
    <div class="prolist">
     <div class="clearfix"></div>
    </div><!--prolist/-->
    <div class="heights">&nbsp;</div>
    <nav>
     
<dl>
	<dt>
		<a href="./index.html"><img
			src="./images/nav1.png" width="65" height="35" /></a>
	</dt>
	<dd>
		<a href="./index.html">首页</a>
	</dd>
</dl>
<dl>
	
	
	<dt>	
		<a href="./login.html"><img
			src="./images/nav2.png" width="65" height="35" /></a>
	</dt>
	<dd>
		<a href="./login.html">精确查找</a>
	</dd>
	
</dl>
<dl>
	<dt>
		<a href="./novice.jsp"><img
			src="./images/nav3.png" width="65" height="35" /></a>
	</dt>
	<dd>
		<a href="./novice.jsp">新手教程</a>
	</dd>
</dl>


<dl>
	<dt>
		<a href="./login.html"><img
			src="./images/nav4.png" width="65" height="35" /></a>
	</dt>
	<dd>
		<a href="./login.html">会员中心</a>
	</dd>
</dl>

<div class="clearfix"></div>
    </nav>
    <!-- 模态框（Modal） -->
	<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">提醒</h4>
				</div>
				<div class="modal-body" id="modelText"></div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭
					</button>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="./js/lib/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="./js/lib/bootstrap.min.js"></script>
    <script src="./js/lib/style.js"></script>
    <!--轮播图特效-->
    <script src="./js/lib/jquery.excoloSlider.js"></script>
    <style>
    .slider{max-width:640px;margin:0px auto; margin-top:5px;text-align:center;}
    </style>
    <script>
   $(function () {
	  //$('.ad').on("touchstart",function (){
			//    	window.location.href=$(this).attr("picUrl");
			  //  });
      $("#sliderA").excoloSlider();
	  $(".es-pager").hide();
	  //导航定位
	  $("nav dl:eq(0)").addClass("navCur");
    });
	//判断是否为微信浏览器
	function isWeiXin(){ 
		var ua = window.navigator.userAgent.toLowerCase(); 
		if(ua.match(/MicroMessenger/i) == 'micromessenger'){ 
			return true; 
		}else{ 
			return false; 
		} 
	}
    //下载通迅录
    function downloadPhonebook(){
    	if(isWeiXin()){
    		$("#modelText").text("由于微信不支持下载文件操作，请您点击右上角菜单，选择在浏览器中打开！");
			$('#myModal').modal();
    		return false;
    	}else{
    		$.ajax({
    			url : 'http://www.udppvr.cn:80/profile/oneKeyDownload.do',
    			async : false,
    			success : function (rs){
    				if(rs.iserror) {
    					$("#modelText").text(rs.message);
    					$('#myModal').modal();
    		    		return false;
    				}else{
    					window.location.href="http://www.udppvr.cn:80/static/vcf/"+rs.message;
    				}
    			},
    			dataType : 'json'
    		});
    	}
    }
    </script>
  </body>
</html>